package com.ldzl.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 库位表
 * @TableName ck_storage_area
 */
@TableName(value ="ck_storage_area")
@Data
public class CkStorageArea implements Serializable {
    /**
     * 库位ID
     */
    @TableId(type = IdType.AUTO)
    private Long area_id;

    /**
     * 库位编码
     */
    private String area_code;

    /**
     * 库位名称
     */
    private String area_name;

    /**
     * 库区ID
     */
    private Long location_id;

    /**
     * 单位ID
     */
    private Long unit_id;

    /**
     * 面积
     */
    private Double area;

    /**
     * 最大载重量
     */
    private BigDecimal max_weight;

    /**
     * 当前存放重量
     */
    private BigDecimal current_weight;

    /**
     * 库位位置X
     */
    private Integer position_x;

    /**
     * 库位位置y
     */
    private Integer position_y;

    /**
     * 库位位置z
     */
    private Integer position_z;

    /**
     * 是否可用
     */
    private String enable_flag;

    /**
     * 是否冻结
     */
    private String frozen_flag;

    /**
     * 是否允许产品混放
     */
    private String product_mixing;

    /**
     * 是否允许批次混放
     */
    private String batch_mixing;

    /**
     * 备注
     */
    private String remark;

    /**
     * 预留字段1
     */
    private String attr1;

    /**
     * 预留字段2
     */
    private String attr2;

    /**
     * 预留字段3
     */
    private Integer attr3;

    /**
     * 预留字段4
     */
    private Integer attr4;

    /**
     * 创建者
     */
    private String create_by;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_time;

    /**
     * 更新者
     */
    private String update_by;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date update_time;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    private String is_delete;

    /**
     * 单位表 引用
     */
    @TableField(exist = false)
    private BasicUnits units;

    /**
     * 当前已用容量
     */
    @TableField(exist = false)
    private BigDecimal used_capacity;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CkStorageArea other = (CkStorageArea) that;
        return (this.getArea_id() == null ? other.getArea_id() == null : this.getArea_id().equals(other.getArea_id()))
            && (this.getArea_code() == null ? other.getArea_code() == null : this.getArea_code().equals(other.getArea_code()))
            && (this.getArea_name() == null ? other.getArea_name() == null : this.getArea_name().equals(other.getArea_name()))
            && (this.getLocation_id() == null ? other.getLocation_id() == null : this.getLocation_id().equals(other.getLocation_id()))
            && (this.getUnit_id() == null ? other.getUnit_id() == null : this.getUnit_id().equals(other.getUnit_id()))
            && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
            && (this.getMax_weight() == null ? other.getMax_weight() == null : this.getMax_weight().equals(other.getMax_weight()))
            && (this.getCurrent_weight() == null ? other.getCurrent_weight() == null : this.getCurrent_weight().equals(other.getCurrent_weight()))
            && (this.getPosition_x() == null ? other.getPosition_x() == null : this.getPosition_x().equals(other.getPosition_x()))
            && (this.getPosition_y() == null ? other.getPosition_y() == null : this.getPosition_y().equals(other.getPosition_y()))
            && (this.getPosition_z() == null ? other.getPosition_z() == null : this.getPosition_z().equals(other.getPosition_z()))
            && (this.getEnable_flag() == null ? other.getEnable_flag() == null : this.getEnable_flag().equals(other.getEnable_flag()))
            && (this.getFrozen_flag() == null ? other.getFrozen_flag() == null : this.getFrozen_flag().equals(other.getFrozen_flag()))
            && (this.getProduct_mixing() == null ? other.getProduct_mixing() == null : this.getProduct_mixing().equals(other.getProduct_mixing()))
            && (this.getBatch_mixing() == null ? other.getBatch_mixing() == null : this.getBatch_mixing().equals(other.getBatch_mixing()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getAttr1() == null ? other.getAttr1() == null : this.getAttr1().equals(other.getAttr1()))
            && (this.getAttr2() == null ? other.getAttr2() == null : this.getAttr2().equals(other.getAttr2()))
            && (this.getAttr3() == null ? other.getAttr3() == null : this.getAttr3().equals(other.getAttr3()))
            && (this.getAttr4() == null ? other.getAttr4() == null : this.getAttr4().equals(other.getAttr4()))
            && (this.getCreate_by() == null ? other.getCreate_by() == null : this.getCreate_by().equals(other.getCreate_by()))
            && (this.getCreate_time() == null ? other.getCreate_time() == null : this.getCreate_time().equals(other.getCreate_time()))
            && (this.getUpdate_by() == null ? other.getUpdate_by() == null : this.getUpdate_by().equals(other.getUpdate_by()))
            && (this.getUpdate_time() == null ? other.getUpdate_time() == null : this.getUpdate_time().equals(other.getUpdate_time()))
            && (this.getIs_delete() == null ? other.getIs_delete() == null : this.getIs_delete().equals(other.getIs_delete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getArea_id() == null) ? 0 : getArea_id().hashCode());
        result = prime * result + ((getArea_code() == null) ? 0 : getArea_code().hashCode());
        result = prime * result + ((getArea_name() == null) ? 0 : getArea_name().hashCode());
        result = prime * result + ((getLocation_id() == null) ? 0 : getLocation_id().hashCode());
        result = prime * result + ((getUnit_id() == null) ? 0 : getUnit_id().hashCode());
        result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
        result = prime * result + ((getMax_weight() == null) ? 0 : getMax_weight().hashCode());
        result = prime * result + ((getCurrent_weight() == null) ? 0 : getCurrent_weight().hashCode());
        result = prime * result + ((getPosition_x() == null) ? 0 : getPosition_x().hashCode());
        result = prime * result + ((getPosition_y() == null) ? 0 : getPosition_y().hashCode());
        result = prime * result + ((getPosition_z() == null) ? 0 : getPosition_z().hashCode());
        result = prime * result + ((getEnable_flag() == null) ? 0 : getEnable_flag().hashCode());
        result = prime * result + ((getFrozen_flag() == null) ? 0 : getFrozen_flag().hashCode());
        result = prime * result + ((getProduct_mixing() == null) ? 0 : getProduct_mixing().hashCode());
        result = prime * result + ((getBatch_mixing() == null) ? 0 : getBatch_mixing().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getAttr1() == null) ? 0 : getAttr1().hashCode());
        result = prime * result + ((getAttr2() == null) ? 0 : getAttr2().hashCode());
        result = prime * result + ((getAttr3() == null) ? 0 : getAttr3().hashCode());
        result = prime * result + ((getAttr4() == null) ? 0 : getAttr4().hashCode());
        result = prime * result + ((getCreate_by() == null) ? 0 : getCreate_by().hashCode());
        result = prime * result + ((getCreate_time() == null) ? 0 : getCreate_time().hashCode());
        result = prime * result + ((getUpdate_by() == null) ? 0 : getUpdate_by().hashCode());
        result = prime * result + ((getUpdate_time() == null) ? 0 : getUpdate_time().hashCode());
        result = prime * result + ((getIs_delete() == null) ? 0 : getIs_delete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", area_id=").append(area_id);
        sb.append(", area_code=").append(area_code);
        sb.append(", area_name=").append(area_name);
        sb.append(", location_id=").append(location_id);
        sb.append(", unit_id=").append(unit_id);
        sb.append(", area=").append(area);
        sb.append(", max_weight=").append(max_weight);
        sb.append(", current_weight=").append(current_weight);
        sb.append(", position_x=").append(position_x);
        sb.append(", position_y=").append(position_y);
        sb.append(", position_z=").append(position_z);
        sb.append(", enable_flag=").append(enable_flag);
        sb.append(", frozen_flag=").append(frozen_flag);
        sb.append(", product_mixing=").append(product_mixing);
        sb.append(", batch_mixing=").append(batch_mixing);
        sb.append(", remark=").append(remark);
        sb.append(", attr1=").append(attr1);
        sb.append(", attr2=").append(attr2);
        sb.append(", attr3=").append(attr3);
        sb.append(", attr4=").append(attr4);
        sb.append(", create_by=").append(create_by);
        sb.append(", create_time=").append(create_time);
        sb.append(", update_by=").append(update_by);
        sb.append(", update_time=").append(update_time);
        sb.append(", is_delete=").append(is_delete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}